home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / SDKs / QuickTime Mac / PInterfaces / QD3DExtension.p < prev    next >
Encoding:
Text File  |  1998-04-09  |  8.8 KB  |  305 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        QD3DExtension.p
  3.  
  4.      Contains:    QuickDraw 3D Plug-in Architecture     Interface File.                                
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.5.4
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT QD3DExtension;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __QD3DEXTENSION__}
  28. {$SETC __QD3DEXTENSION__ := 1}
  29.  
  30. {$I+}
  31. {$SETC QD3DExtensionIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __QD3D__}
  35. {$I QD3D.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __QD3DERRORS__}
  38. {$I QD3DErrors.p}
  39. {$ENDC}
  40.  
  41.  
  42. {$PUSH}
  43. {$ALIGN POWER}
  44. {$LibExport+}
  45.  
  46. {*****************************************************************************
  47.  **                                                                             **
  48.  **                                Constants                                      **
  49.  **                                                                             **
  50.  ****************************************************************************}
  51. {$IFC TARGET_OS_MAC }
  52.  
  53. CONST
  54.     kQ3XExtensionMacCreatorType    = 'Q3XT';
  55.     kQ3XExtensionMacFileType    = 'shlb';
  56.  
  57. {$ENDC}  {TARGET_OS_MAC}
  58.  
  59.  
  60. {*****************************************************************************
  61.  **                                                                             **
  62.  **                                Object Method types                              **
  63.  **                                                                             **
  64.  ****************************************************************************}
  65.  
  66. CONST
  67.     kQ3XMethodTypeObjectClassVersion = 'vrsn';
  68.  
  69.  
  70. TYPE
  71.     TQ3XObjectClassVersion                = UInt32;
  72.  
  73. CONST
  74.     kQ3XMethodTypeObjectClassRegister = 'rgst';
  75.  
  76.  
  77. TYPE
  78. {$IFC TYPED_FUNCTION_POINTERS}
  79.     TQ3XObjectClassRegisterMethod = FUNCTION(objectClass: TQ3XObjectClass; classPrivate: UNIV Ptr): TQ3Status; C;
  80. {$ELSEC}
  81.     TQ3XObjectClassRegisterMethod = ProcPtr;
  82. {$ENDC}
  83.  
  84.  
  85. CONST
  86.     kQ3XMethodTypeObjectClassReplace = 'rgrp';
  87.  
  88.  
  89. TYPE
  90. {$IFC TYPED_FUNCTION_POINTERS}
  91.     TQ3XObjectClassReplaceMethod = PROCEDURE(oldObjectClass: TQ3XObjectClass; oldClassPrivate: UNIV Ptr; newObjectClass: TQ3XObjectClass; newClassPrivate: UNIV Ptr); C;
  92. {$ELSEC}
  93.     TQ3XObjectClassReplaceMethod = ProcPtr;
  94. {$ENDC}
  95.  
  96.  
  97. CONST
  98.     kQ3XMethodTypeObjectClassUnregister = 'unrg';
  99.  
  100.  
  101. TYPE
  102. {$IFC TYPED_FUNCTION_POINTERS}
  103.     TQ3XObjectClassUnregisterMethod = PROCEDURE(objectClass: TQ3XObjectClass; classPrivate: UNIV Ptr); C;
  104. {$ELSEC}
  105.     TQ3XObjectClassUnregisterMethod = ProcPtr;
  106. {$ENDC}
  107.  
  108.  
  109. CONST
  110.     kQ3XMethodTypeObjectNew        = 'newo';
  111.  
  112.  
  113. TYPE
  114. {$IFC TYPED_FUNCTION_POINTERS}
  115.     TQ3XObjectNewMethod = FUNCTION(object: TQ3Object; privateData: UNIV Ptr; parameters: UNIV Ptr): TQ3Status; C;
  116. {$ELSEC}
  117.     TQ3XObjectNewMethod = ProcPtr;
  118. {$ENDC}
  119.  
  120.  
  121. CONST
  122.     kQ3XMethodTypeObjectDelete    = 'dlte';
  123.  
  124.  
  125. TYPE
  126. {$IFC TYPED_FUNCTION_POINTERS}
  127.     TQ3XObjectDeleteMethod = PROCEDURE(object: TQ3Object; privateData: UNIV Ptr); C;
  128. {$ELSEC}
  129.     TQ3XObjectDeleteMethod = ProcPtr;
  130. {$ENDC}
  131.  
  132.  
  133. CONST
  134.     kQ3XMethodTypeObjectDuplicate = 'dupl';
  135.  
  136.  
  137. TYPE
  138. {$IFC TYPED_FUNCTION_POINTERS}
  139.     TQ3XObjectDuplicateMethod = FUNCTION(fromObject: TQ3Object; fromPrivateData: UNIV Ptr; toObject: TQ3Object; toPrivateData: UNIV Ptr): TQ3Status; C;
  140. {$ELSEC}
  141.     TQ3XObjectDuplicateMethod = ProcPtr;
  142. {$ENDC}
  143.  
  144. {$IFC TYPED_FUNCTION_POINTERS}
  145.     TQ3XSharedLibraryRegister = FUNCTION: TQ3Status; C;
  146. {$ELSEC}
  147.     TQ3XSharedLibraryRegister = ProcPtr;
  148. {$ENDC}
  149.  
  150. {*****************************************************************************
  151.  **                                                                             **
  152.  **                            Object Hierarchy Registration                      **
  153.  **                                                                             **
  154.  ****************************************************************************}
  155. {
  156.  *    Q3XObjectHierarchy_RegisterClass
  157.  *    
  158.  *    Register an object class in the QuickDraw 3D hierarchy.
  159.  *    
  160.  *    parentType            - an existing type in the hierarchy, or 0 to subclass
  161.  *                            TQ3Object
  162.  *    objectType            - the new object class type, used in the binary 
  163.  *                        metafile.  This is assigned at run time and returned
  164.  *                          to you.
  165.  *    objectName            - the new object name, used in the text metafile
  166.  *    metaHandler            - a TQ3XMetaHandler (may be NULL for some classes) 
  167.  *                          which returns non-virtual methods
  168.  *    virtualMetaHandler    - a TQ3XMetaHandler (may be NULL as well) which returns
  169.  *                            virtual methods a child would inherit
  170.  *    methodsSize            - the size of the class data needed (see 
  171.  *                            GetClassPrivate calls below)
  172.  *    instanceSize        - the size of the object instance data needed (see 
  173.  *                            GetPrivate calls below)
  174.  }
  175. FUNCTION Q3XObjectHierarchy_RegisterClass(parentType: TQ3ObjectType; VAR objectType: TQ3ObjectType; objectName: CStringPtr; metaHandler: TQ3XMetaHandler; virtualMetaHandler: TQ3XMetaHandler; methodsSize: UInt32; instanceSize: UInt32): TQ3XObjectClass; C;
  176. {
  177.  *    Q3XObjectHierarchy_UnregisterClass
  178.  *    
  179.  *    Returns kQ3Failure if the objectClass still has objects 
  180.  * around; the class remains registered.
  181.  }
  182. FUNCTION Q3XObjectHierarchy_UnregisterClass(objectClass: TQ3XObjectClass): TQ3Status; C;
  183. {
  184.  *    Q3XObjectHierarchy_GetMethod
  185.  *    
  186.  *    For use in TQ3XObjectClassRegisterMethod call
  187.  }
  188. FUNCTION Q3XObjectClass_GetMethod(objectClass: TQ3XObjectClass; methodType: TQ3XMethodType): TQ3XFunctionPointer; C;
  189. {
  190.  *    Q3XObjectHierarchy_NewObject
  191.  *    
  192.  *    To create a new object. Parameters is passed into the 
  193.  *    TQ3XObjectNewMethod as the "parameters" parameter.
  194.  }
  195. FUNCTION Q3XObjectHierarchy_NewObject(objectClass: TQ3XObjectClass; parameters: UNIV Ptr): TQ3Object; C;
  196. {
  197.  *    Q3XObjectClass_GetLeafType
  198.  *    
  199.  *    Return the leaf type of a class.
  200.  }
  201. FUNCTION Q3XObjectClass_GetLeafType(objectClass: TQ3XObjectClass): TQ3ObjectType; C;
  202. {
  203.  *    Q3XObjectClass_GetVersion
  204.  *    This routine obtains the the version of a class, referenced by an
  205.  *    object class type.  Functions for getting the type are in QD3D.h,
  206.  *    if you have the class name.
  207.  }
  208. FUNCTION Q3XObjectHierarchy_GetClassVersion(objectClassType: TQ3ObjectType; VAR version: TQ3XObjectClassVersion): TQ3Status; C;
  209. {
  210.  *    Q3XObjectClass_GetType 
  211.  *
  212.  *    This can be used to get the type, given a reference 
  213.  *    to a class.  This is most useful in the instance where you register a 
  214.  *    an element/attribute and need to get the type.  When you register an
  215.  *    element, QD3D will take the type you pass in and modify it (to avoid
  216.  *    namespace clashes).  Many object system calls require an object type
  217.  *    so this API call allows you to get the type from the class referernce
  218.  *    that you will ordinarily store when you register the class.
  219.  }
  220. FUNCTION Q3XObjectClass_GetType(objectClass: TQ3XObjectClass; VAR theType: TQ3ObjectType): TQ3Status; C;
  221.  
  222. FUNCTION Q3XObjectHierarchy_FindClassByType(theType: TQ3ObjectType): TQ3XObjectClass; C;
  223.  
  224.  
  225. {
  226.  *    Q3XObjectClass_GetPrivate
  227.  *    
  228.  *    Return a pointer to private instance data, a block of instanceSize bytes, 
  229.  *    from the Q3XObjectHierarchy_RegisterClass call.
  230.  *    
  231.  *    If instanceSize was zero, NULL is always returned.
  232.  }
  233. FUNCTION Q3XObjectClass_GetPrivate(objectClass: TQ3XObjectClass; targetObject: TQ3Object): Ptr; C;
  234. {
  235.  * Return the "TQ3XObjectClass" of an object
  236.  }
  237. FUNCTION Q3XObject_GetClass(object: TQ3Object): TQ3XObjectClass; C;
  238.  
  239.  
  240. {*****************************************************************************
  241.  **                                                                             **
  242.  **                    Shared Library Registration Entry Point                      **
  243.  **                                                                             **
  244.  ****************************************************************************}
  245.  
  246. TYPE
  247.     TQ3XSharedLibraryInfoPtr = ^TQ3XSharedLibraryInfo;
  248.     TQ3XSharedLibraryInfo = RECORD
  249.         registerFunction:        TQ3XSharedLibraryRegister;
  250.         sharedLibrary:            UInt32;
  251.     END;
  252.  
  253. FUNCTION Q3XSharedLibrary_Register(VAR sharedLibraryInfo: TQ3XSharedLibraryInfo): TQ3Status; C;
  254. FUNCTION Q3XSharedLibrary_Unregister(sharedLibrary: UInt32): TQ3Status; C;
  255.  
  256. {*****************************************************************************
  257.  **                                                                             **
  258.  **                                Posting Errors                                  **
  259.  **                                                                             **
  260.  **            You may only call these functions from within an extension         **
  261.  **                                                                             **
  262.  ****************************************************************************}
  263. {
  264.  *    Q3XError_Post
  265.  *    
  266.  *    Post a QuickDraw 3D Error from an extension.
  267.  }
  268. PROCEDURE Q3XError_Post(error: TQ3Error); C;
  269. {
  270.  *    Q3XWarning_Post
  271.  *    
  272.  *    Post a QuickDraw 3D Warning, from an extension.  Note the warning code you
  273.  *    pass into this routine must already be defined in the table above.
  274.  }
  275. PROCEDURE Q3XWarning_Post(warning: TQ3Warning); C;
  276. {
  277.  *    Q3XNotice_Post
  278.  *    
  279.  *    Post a QuickDraw 3D Notice, from an extension.  Note the notice code you
  280.  *    pass into this routine must already be defined in the table above.
  281.  }
  282. PROCEDURE Q3XNotice_Post(notice: TQ3Notice); C;
  283.  
  284. {$IFC TARGET_OS_MAC }
  285. {
  286.  *    Q3XMacintoshError_Post
  287.  *    
  288.  *    Post the QuickDraw 3D Error, kQ3ErrorMacintoshError, and the Macintosh
  289.  *    OSErr macOSErr. (Retrieved with Q3MacintoshError_Get)
  290.  }
  291. PROCEDURE Q3XMacintoshError_Post(macOSErr: OSErr); C;
  292. {$ENDC}  {TARGET_OS_MAC}
  293.  
  294.  
  295. {$ALIGN RESET}
  296. {$POP}
  297.  
  298. {$SETC UsingIncludes := QD3DExtensionIncludes}
  299.  
  300. {$ENDC} {__QD3DEXTENSION__}
  301.  
  302. {$IFC NOT UsingIncludes}
  303.  END.
  304. {$ENDC}
  305.